package com.base.syslib.view.wheelview.city.model;

import java.util.List;

public class CityModel {

    private String code;
    private String region;
    private List<DistrictModel> regionEntityList;

    public CityModel() {
        super();
    }

    public CityModel(String code, String name, List<DistrictModel> districtList) {
        super();
        this.code = code;
        this.region = name;
        this.regionEntityList = districtList;
    }

    public String getCode() {
        if (code.length() > 4) {
            return code.substring(0, 4);
        }
        return code;
    }

    public void setCode(String code) {

        this.code = code;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public List<DistrictModel> getRegionEntityList() {
        return regionEntityList;
    }

    public void setRegionEntityList(List<DistrictModel> regionEntityList) {
        this.regionEntityList = regionEntityList;
    }

    @Override
    public String toString() {
        return "CityModel [name=" + region + ", districtList=" + regionEntityList
                + "]";
    }

}
